﻿<navigation:Page 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
            x:Class="iFinance.Modules.Outgoings.Views.OutgoingsPage"
           mc:Ignorable="d"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="支出明细" >
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="40" />
        </Grid.RowDefinitions>
        <sdk:DataGrid x:Name="dgOutgoingsList" ItemsSource="{Binding List}" AutoGenerateColumns="False" SelectionMode="Single">
            <sdk:DataGrid.Columns>
                <!--<sdk:DataGridTemplateColumn Header="选择">
                    <sdk:DataGridTemplateColumn.CellStyle>
                        <Style TargetType="sdk:DataGridCell">
                            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        </Style>
                    </sdk:DataGridTemplateColumn.CellStyle>
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{Binding IsChecked}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>-->
                <sdk:DataGridCheckBoxColumn Header="选择" Binding="{Binding IsChecked}"/>
                <sdk:DataGridTextColumn Header="支出日期" Binding="{Binding Date,StringFormat=yyyy-MM-dd}" IsReadOnly="True"/>
                <sdk:DataGridTextColumn Header="支出事由" Binding="{Binding OutgoingsType.Name}" IsReadOnly="True"/>
                <sdk:DataGridTextColumn Header="支出金额" Binding="{Binding TotalAmount,StringFormat=N2}" IsReadOnly="True"/>
                <sdk:DataGridTextColumn Header="支出地点" Binding="{Binding Location}" IsReadOnly="True"/>
                <sdk:DataGridTextColumn Header="支出说明" Binding="{Binding Description}" IsReadOnly="True"/>
                <sdk:DataGridTextColumn Header="修改时间" Binding="{Binding LastModifyDate,StringFormat=yyyy-MM-dd HH:mm:ss}" IsReadOnly="True"/>
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
        <Button x:Name="btnAdd" Content="添加" Command="{Binding AddOutgoingsCommand}" Height="24" Width="75" Grid.Row="1" HorizontalAlignment="Right" Margin="0,8,162,8"/>
        <Button x:Name="btnModify" Content="修改" Command="{Binding ModifyOutgoingsCommand}" CommandParameter="{Binding ElementName=dgOutgoingsList,Path=SelectedItem}" Height="24" Width="75" Grid.Row="1" HorizontalAlignment="Right" Margin="0,8,83,8"/>
        <Button x:Name="btnDelete" Content="删除所选" Command="{Binding DeleteOutgoingsCommand}" Height="24" Width="75" Grid.Row="1" HorizontalAlignment="Right" Margin="0,0,4,0"/>
    </Grid>
</navigation:Page>
